﻿
namespace myLittleC
{

	enum ERRORS
    {
        EOF,
        
        UnknownError,
        
        InvalidConstInt,
        InvalidConstString,
        InvalidConstFloat,
        InvalidEscSeq,

        //Parser
        BadExpression, 
        BadUnaryExp,
        ExpRightParan,
        BadLValue,
        NotIdent,

        
        //Sim Declarations
        BadDeclaration,
        DublDeclaration,

        NotDefType,

        //Parse Defs

        ExpSemicolon,
        NotUniqDef,
        NotArraySize,
        ExpRBreak,
        CantDefsVar,
        CantDefsFunc,
        ExpFinBrace,
        ExpIdent,
        ExpType,
        ExpComma,
        UnIdefSymbol,
        CanDefsExpr,
		EmpryStruct,
		NotUnicDefOrCantDefsFunk,
        ExpDef,
        SecSetType,
        IncorectType,
        UnKnownOp,
        ExpStartParan,
        ExpFinishParan,
        ExpFinishSquareBracket,
        ElseBeforeIf,
        ElseBeforeElseIf,
        ExpWhile,
        OutOfFunc,
        ExpRetValue,
        GlobalVarIsNotConsExpr,
        ExpMainFunk,
        CountArgs,
        TypesNotCoincide,
        

        ReturnWithOutFunc,

        BadInitialization,
        BadCondition,
    }

    enum TokenType
    {
        None = 0,
        EOF,    

        ConstInt,
        ConstString,
        ConstFloat,

        Operation,
        Separator,

        KeyWord,      
        Identeficator
    }

  enum SubTokenType
    {
        None = 0,

        //ConstTokenType

        ConstTokenTypeStart,
            CttInt,
            CttFloat,
            CttStr,
        ConstTokenTypeEnd,

        //IdentTokenType
       
        ResWordsStarts,
            RwConst,
            RwDo,
            RwElse,
            RwFloat,
            RwFor,
            RwIf,
            RwInt,
            RwPrintf,
            RwReturn,
            RwStruct,         
            RwTypedef,
            RwVoid,
            RwWhile,
        ResWordsFinish,
        Identeficator,

        OperationsStart, //sorted by prioreted
            
            Increment, //++ 
            Decrement, //--
            Not,

            Multiply,
            Division,   // /
            Div,        // %

            Add,
            Sub,

            OperationsLogicalStart,
            SHL = OperationsLogicalStart,
            SHR,

            Low,
            Hi,
            
            LowOrEq,
            HiOrEq,

            Equal,
            NotEqual,
            
            And,

            Or,

            LogicalAnd,

            LogicalOr,
            OperationsLogicalEnd = LogicalOr,
            
            Assignment,
            AddAssignment,     
            SubAssignment,  
            OrAssignment, 
            AndAssignment,           
            MultiplyAssigment,            
            DivisionAssignment,
            DivAssignment,
            Dot, 
            lArow,
        OperationsEnd,

        //SeParatorTokenType
        SeporatorStart,
            SpttLpar,		// PARANTHESIS ( )
            SpttRpar,
            SpttComma,		//,
            SpttColon,		//:
            SpttSemicolon,	//;
            SpttLbracket,	// SQUARE BRACKET  []
            SpttRbracket,
            SpttLbrace,	//фигурные {}
            SpttRbrace,        
        SeporatorEnd,

        EOF = 1000
    }
    
    enum CONDITIONS
    {
        WhiteSpaces = 0,
        IntConst = 1,
        IntOctConst = 40,
        IntHexConst = 41,
        FloatConst = 2,
        Identifier = 6,
        ZnakOperaciiOne,
        ZnakOperaciiTwo,
        Division,
        CommentOdn,
        Or,
        LogicalOr,
        And,
        LogicalAnd,
        Separator,
        CommentMnog = 16,        
        StringConst = 18,
        EOF = 20,
        Add = 22,
        Increment,
        AddAssignment,
        Substraction,
        Decrement,
        SubAssignment,
        Low,
        Shl,
        LowOrEq,
        Hi,
        Shr,
        HiOrEq,
        Dot,
        lArrow =42,

        UnGet = 200,	
        Get,		
        Error,				
        ErrorInConst,	
        ErrorEofComment,
    }  
}
